package auth

import (
	"EnjoyWorking/utils/icasbin"
)

func InitAuth() {
	icasbin.InitCasbin()
	icasbin.Casbin().AddFunction("myFunc", myFunc)
}

func myFunc(args ...interface{}) (interface{}, error) {
	match := func(key string) bool {
		if key == "/api/user/logout" || key == "/api/user/profile" {
			return true
		}
		return false
	}(args[0].(string))
	return (bool)(match), nil
}
